package org.ky.generator.expand;

import java.util.HashMap;

import org.apache.log4j.Logger;

/**
 * 通用查询器
 * 
 * @author K.y
 *
 */
public class DefaultCriteria extends HashMap<String, Object> {
	private static final long serialVersionUID = 1L;
	protected final Logger logger = Logger.getLogger(this.getClass());

	protected static final Integer DEFAULT_SIZE = 20;

	/**
	 * 通用的获取Long值
	 * 
	 * @param key
	 * @return
	 */
	public Long getLongValue(String key) {
		try {
			return (Long) (this.getOrDefault(key, null));
		} catch (Exception e) {
			logger.error("获取Key[" + key + "]的Long值异常", e);
			return null;
		}
	}

	/**
	 * 通用的获取Long值
	 * 
	 * @param key
	 * @return
	 */
	public String getStringValue(String key) {
		try {
			return (String) (this.getOrDefault(key, null));
		} catch (Exception e) {
			logger.error("获取Key[" + key + "]的String值异常", e);
			return null;
		}
	}
}
